%
% Status : main Dynare file
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

if isoctave || matlab_ver_less_than('8.6')
    clear all
else
    clearvars -global
    clear_persistent_variables(fileparts(which('dynare')), false)
end
tic0 = tic;
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'bbeffectivedemandmatchirf_order3';
M_.dynare_version = '5.1';
oo_.dynare_version = '5.1';
options_.dynare_version = '5.1';
%
% Some global variables initialization
%
global_initialization;
M_.exo_names = cell(3,1);
M_.exo_names_tex = cell(3,1);
M_.exo_names_long = cell(3,1);
M_.exo_names(1) = {'ea'};
M_.exo_names_tex(1) = {'ea'};
M_.exo_names_long(1) = {'ea'};
M_.exo_names(2) = {'evola'};
M_.exo_names_tex(2) = {'evola'};
M_.exo_names_long(2) = {'evola'};
M_.exo_names(3) = {'ez'};
M_.exo_names_tex(3) = {'ez'};
M_.exo_names_long(3) = {'ez'};
M_.endo_names = cell(30,1);
M_.endo_names_tex = cell(30,1);
M_.endo_names_long = cell(30,1);
M_.endo_names(1) = {'a'};
M_.endo_names_tex(1) = {'a'};
M_.endo_names_long(1) = {'a'};
M_.endo_names(2) = {'c'};
M_.endo_names_tex(2) = {'c'};
M_.endo_names_long(2) = {'c'};
M_.endo_names(3) = {'de'};
M_.endo_names_tex(3) = {'de'};
M_.endo_names_long(3) = {'de'};
M_.endo_names(4) = {'deltau'};
M_.endo_names_tex(4) = {'deltau'};
M_.endo_names_long(4) = {'deltau'};
M_.endo_names(5) = {'deltauprime'};
M_.endo_names_tex(5) = {'deltauprime'};
M_.endo_names_long(5) = {'deltauprime'};
M_.endo_names(6) = {'expre'};
M_.endo_names_tex(6) = {'expre'};
M_.endo_names_long(6) = {'expre'};
M_.endo_names(7) = {'expre2'};
M_.endo_names_tex(7) = {'expre2'};
M_.endo_names_long(7) = {'expre2'};
M_.endo_names(8) = {'expvf1sigma'};
M_.endo_names_tex(8) = {'expvf1sigma'};
M_.endo_names_long(8) = {'expvf1sigma'};
M_.endo_names(9) = {'inv'};
M_.endo_names_tex(9) = {'inv'};
M_.endo_names_long(9) = {'inv'};
M_.endo_names(10) = {'k'};
M_.endo_names_tex(10) = {'k'};
M_.endo_names_long(10) = {'k'};
M_.endo_names(11) = {'mu'};
M_.endo_names_tex(11) = {'mu'};
M_.endo_names_long(11) = {'mu'};
M_.endo_names(12) = {'n'};
M_.endo_names_tex(12) = {'n'};
M_.endo_names_long(12) = {'n'};
M_.endo_names(13) = {'pe'};
M_.endo_names_tex(13) = {'pe'};
M_.endo_names_long(13) = {'pe'};
M_.endo_names(14) = {'pie'};
M_.endo_names_tex(14) = {'pie'};
M_.endo_names_long(14) = {'pie'};
M_.endo_names(15) = {'profit'};
M_.endo_names_tex(15) = {'profit'};
M_.endo_names_long(15) = {'profit'};
M_.endo_names(16) = {'q'};
M_.endo_names_tex(16) = {'q'};
M_.endo_names_long(16) = {'q'};
M_.endo_names(17) = {'r'};
M_.endo_names_tex(17) = {'r'};
M_.endo_names_long(17) = {'r'};
M_.endo_names(18) = {'rr'};
M_.endo_names_tex(18) = {'rr'};
M_.endo_names_long(18) = {'rr'};
M_.endo_names(19) = {'rrk'};
M_.endo_names_tex(19) = {'rrk'};
M_.endo_names_long(19) = {'rrk'};
M_.endo_names(20) = {'sdf'};
M_.endo_names_tex(20) = {'sdf'};
M_.endo_names_long(20) = {'sdf'};
M_.endo_names(21) = {'u'};
M_.endo_names_tex(21) = {'u'};
M_.endo_names_long(21) = {'u'};
M_.endo_names(22) = {'varexpre'};
M_.endo_names_tex(22) = {'varexpre'};
M_.endo_names_long(22) = {'varexpre'};
M_.endo_names(23) = {'vf'};
M_.endo_names_tex(23) = {'vf'};
M_.endo_names_long(23) = {'vf'};
M_.endo_names(24) = {'vola'};
M_.endo_names_tex(24) = {'vola'};
M_.endo_names_long(24) = {'vola'};
M_.endo_names(25) = {'w'};
M_.endo_names_tex(25) = {'w'};
M_.endo_names_long(25) = {'w'};
M_.endo_names(26) = {'y'};
M_.endo_names_tex(26) = {'y'};
M_.endo_names_long(26) = {'y'};
M_.endo_names(27) = {'z'};
M_.endo_names_tex(27) = {'z'};
M_.endo_names_long(27) = {'z'};
M_.endo_names(28) = {'eee_1'};
M_.endo_names_tex(28) = {'eee\_1'};
M_.endo_names_long(28) = {'eee_1'};
M_.endo_names(29) = {'eee_2'};
M_.endo_names_tex(29) = {'eee\_2'};
M_.endo_names_long(29) = {'eee_2'};
M_.endo_names(30) = {'eee_3'};
M_.endo_names_tex(30) = {'eee\_3'};
M_.endo_names_long(30) = {'eee_3'};
M_.endo_partitions = struct();
M_.param_names = cell(52,1);
M_.param_names_tex = cell(52,1);
M_.param_names_long = cell(52,1);
M_.param_names(1) = {'alpha'};
M_.param_names_tex(1) = {'alpha'};
M_.param_names_long(1) = {'alpha'};
M_.param_names(2) = {'beta'};
M_.param_names_tex(2) = {'beta'};
M_.param_names_long(2) = {'beta'};
M_.param_names(3) = {'delta0'};
M_.param_names_tex(3) = {'delta0'};
M_.param_names_long(3) = {'delta0'};
M_.param_names(4) = {'delta1'};
M_.param_names_tex(4) = {'delta1'};
M_.param_names_long(4) = {'delta1'};
M_.param_names(5) = {'delta2'};
M_.param_names_tex(5) = {'delta2'};
M_.param_names_long(5) = {'delta2'};
M_.param_names(6) = {'eta'};
M_.param_names_tex(6) = {'eta'};
M_.param_names_long(6) = {'eta'};
M_.param_names(7) = {'phip'};
M_.param_names_tex(7) = {'phip'};
M_.param_names_long(7) = {'phip'};
M_.param_names(8) = {'phik'};
M_.param_names_tex(8) = {'phik'};
M_.param_names_long(8) = {'phik'};
M_.param_names(9) = {'sigma'};
M_.param_names_tex(9) = {'sigma'};
M_.param_names_long(9) = {'sigma'};
M_.param_names(10) = {'ies'};
M_.param_names_tex(10) = {'ies'};
M_.param_names_long(10) = {'ies'};
M_.param_names(11) = {'frischlse'};
M_.param_names_tex(11) = {'frischlse'};
M_.param_names_long(11) = {'frischlse'};
M_.param_names(12) = {'thetavf'};
M_.param_names_tex(12) = {'thetavf'};
M_.param_names_long(12) = {'thetavf'};
M_.param_names(13) = {'thetamu'};
M_.param_names_tex(13) = {'thetamu'};
M_.param_names_long(13) = {'thetamu'};
M_.param_names(14) = {'leverageratio'};
M_.param_names_tex(14) = {'leverageratio'};
M_.param_names_long(14) = {'leverageratio'};
M_.param_names(15) = {'fixedcost'};
M_.param_names_tex(15) = {'fixedcost'};
M_.param_names_long(15) = {'fixedcost'};
M_.param_names(16) = {'rhor'};
M_.param_names_tex(16) = {'rhor'};
M_.param_names_long(16) = {'rhor'};
M_.param_names(17) = {'rhopie'};
M_.param_names_tex(17) = {'rhopie'};
M_.param_names_long(17) = {'rhopie'};
M_.param_names(18) = {'rhoy'};
M_.param_names_tex(18) = {'rhoy'};
M_.param_names_long(18) = {'rhoy'};
M_.param_names(19) = {'rhoa'};
M_.param_names_tex(19) = {'rhoa'};
M_.param_names_long(19) = {'rhoa'};
M_.param_names(20) = {'rhovola'};
M_.param_names_tex(20) = {'rhovola'};
M_.param_names_long(20) = {'rhovola'};
M_.param_names(21) = {'volvola'};
M_.param_names_tex(21) = {'volvola'};
M_.param_names_long(21) = {'volvola'};
M_.param_names(22) = {'rhoz'};
M_.param_names_tex(22) = {'rhoz'};
M_.param_names_long(22) = {'rhoz'};
M_.param_names(23) = {'productionconstant'};
M_.param_names_tex(23) = {'productionconstant'};
M_.param_names_long(23) = {'productionconstant'};
M_.param_names(24) = {'utilityconstant'};
M_.param_names_tex(24) = {'utilityconstant'};
M_.param_names_long(24) = {'utilityconstant'};
M_.param_names(25) = {'ass'};
M_.param_names_tex(25) = {'ass'};
M_.param_names_long(25) = {'ass'};
M_.param_names(26) = {'css'};
M_.param_names_tex(26) = {'css'};
M_.param_names_long(26) = {'css'};
M_.param_names(27) = {'dess'};
M_.param_names_tex(27) = {'dess'};
M_.param_names_long(27) = {'dess'};
M_.param_names(28) = {'deltauss'};
M_.param_names_tex(28) = {'deltauss'};
M_.param_names_long(28) = {'deltauss'};
M_.param_names(29) = {'deltauprimess'};
M_.param_names_tex(29) = {'deltauprimess'};
M_.param_names_long(29) = {'deltauprimess'};
M_.param_names(30) = {'express'};
M_.param_names_tex(30) = {'express'};
M_.param_names_long(30) = {'express'};
M_.param_names(31) = {'expre2ss'};
M_.param_names_tex(31) = {'expre2ss'};
M_.param_names_long(31) = {'expre2ss'};
M_.param_names(32) = {'expvf1sigmass'};
M_.param_names_tex(32) = {'expvf1sigmass'};
M_.param_names_long(32) = {'expvf1sigmass'};
M_.param_names(33) = {'invss'};
M_.param_names_tex(33) = {'invss'};
M_.param_names_long(33) = {'invss'};
M_.param_names(34) = {'kss'};
M_.param_names_tex(34) = {'kss'};
M_.param_names_long(34) = {'kss'};
M_.param_names(35) = {'nss'};
M_.param_names_tex(35) = {'nss'};
M_.param_names_long(35) = {'nss'};
M_.param_names(36) = {'muss'};
M_.param_names_tex(36) = {'muss'};
M_.param_names_long(36) = {'muss'};
M_.param_names(37) = {'pess'};
M_.param_names_tex(37) = {'pess'};
M_.param_names_long(37) = {'pess'};
M_.param_names(38) = {'piess'};
M_.param_names_tex(38) = {'piess'};
M_.param_names_long(38) = {'piess'};
M_.param_names(39) = {'profitss'};
M_.param_names_tex(39) = {'profitss'};
M_.param_names_long(39) = {'profitss'};
M_.param_names(40) = {'qss'};
M_.param_names_tex(40) = {'qss'};
M_.param_names_long(40) = {'qss'};
M_.param_names(41) = {'rss'};
M_.param_names_tex(41) = {'rss'};
M_.param_names_long(41) = {'rss'};
M_.param_names(42) = {'rrss'};
M_.param_names_tex(42) = {'rrss'};
M_.param_names_long(42) = {'rrss'};
M_.param_names(43) = {'rrkss'};
M_.param_names_tex(43) = {'rrkss'};
M_.param_names_long(43) = {'rrkss'};
M_.param_names(44) = {'sdfss'};
M_.param_names_tex(44) = {'sdfss'};
M_.param_names_long(44) = {'sdfss'};
M_.param_names(45) = {'uss'};
M_.param_names_tex(45) = {'uss'};
M_.param_names_long(45) = {'uss'};
M_.param_names(46) = {'varexpress'};
M_.param_names_tex(46) = {'varexpress'};
M_.param_names_long(46) = {'varexpress'};
M_.param_names(47) = {'vfss'};
M_.param_names_tex(47) = {'vfss'};
M_.param_names_long(47) = {'vfss'};
M_.param_names(48) = {'volass'};
M_.param_names_tex(48) = {'volass'};
M_.param_names_long(48) = {'volass'};
M_.param_names(49) = {'volzss'};
M_.param_names_tex(49) = {'volzss'};
M_.param_names_long(49) = {'volzss'};
M_.param_names(50) = {'wss'};
M_.param_names_tex(50) = {'wss'};
M_.param_names_long(50) = {'wss'};
M_.param_names(51) = {'yss'};
M_.param_names_tex(51) = {'yss'};
M_.param_names_long(51) = {'yss'};
M_.param_names(52) = {'zss'};
M_.param_names_tex(52) = {'zss'};
M_.param_names_long(52) = {'zss'};
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 3;
M_.endo_nbr = 30;
M_.param_nbr = 52;
M_.orig_endo_nbr = 30;
M_.aux_vars = [];
M_ = setup_solvers(M_);
M_.Sigma_e = zeros(3, 3);
M_.Correlation_matrix = eye(3, 3);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = true;
M_.det_shocks = [];
M_.surprise_shocks = [];
M_.heteroskedastic_shocks.Qvalue_orig = [];
M_.heteroskedastic_shocks.Qscale_orig = [];
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
M_.nonzero_hessian_eqs = [1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 28 29 30];
M_.hessian_eq_zero = isempty(M_.nonzero_hessian_eqs);
M_.orig_eq_nbr = 30;
M_.eq_nbr = 30;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./+' M_.fname '/set_auxiliary_variables.m'], 'file') == 2;
M_.epilogue_names = {};
M_.epilogue_var_list_ = {};
M_.orig_maximum_endo_lag = 1;
M_.orig_maximum_endo_lead = 1;
M_.orig_maximum_exo_lag = 0;
M_.orig_maximum_exo_lead = 0;
M_.orig_maximum_exo_det_lag = 0;
M_.orig_maximum_exo_det_lead = 0;
M_.orig_maximum_lag = 1;
M_.orig_maximum_lead = 1;
M_.orig_maximum_lag_with_diffs_expanded = 1;
M_.lead_lag_incidence = [
 1 10 0;
 2 11 0;
 0 12 40;
 0 13 41;
 0 14 0;
 0 15 0;
 0 16 0;
 3 17 0;
 0 18 42;
 4 19 0;
 0 20 0;
 5 21 0;
 0 22 43;
 0 23 44;
 0 24 0;
 0 25 45;
 6 26 0;
 0 27 0;
 0 28 46;
 0 29 47;
 0 30 48;
 0 31 0;
 0 32 49;
 7 33 0;
 0 34 0;
 8 35 50;
 9 36 0;
 0 37 0;
 0 38 0;
 0 39 0;]';
M_.nstatic = 11;
M_.nfwrd   = 10;
M_.npred   = 8;
M_.nboth   = 1;
M_.nsfwrd   = 11;
M_.nspred   = 9;
M_.ndynamic   = 19;
M_.dynamic_tmp_nbr = [37; 46; 77; 26; ];
M_.model_local_variables_dynamic_tt_idxs = {
};
M_.equations_tags = {
  1 , 'name' , '1' ;
  2 , 'name' , '2' ;
  3 , 'name' , 'w' ;
  4 , 'name' , 'vf' ;
  5 , 'name' , 'expvf1sigma' ;
  6 , 'name' , '6' ;
  7 , 'name' , '7' ;
  8 , 'name' , '8' ;
  9 , 'name' , 'k' ;
  10 , 'name' , 'deltau' ;
  11 , 'name' , 'deltauprime' ;
  12 , 'name' , 'sdf' ;
  13 , 'name' , '13' ;
  14 , 'name' , '14' ;
  15 , 'name' , '15' ;
  16 , 'name' , '16' ;
  17 , 'name' , 'de' ;
  18 , 'name' , '18' ;
  19 , 'name' , '19' ;
  20 , 'name' , '20' ;
  21 , 'name' , 'profit' ;
  22 , 'name' , 'expre' ;
  23 , 'name' , 'expre2' ;
  24 , 'name' , 'varexpre' ;
  25 , 'name' , 'a' ;
  26 , 'name' , 'vola' ;
  27 , 'name' , 'z' ;
  28 , 'name' , 'eee_1' ;
  29 , 'name' , 'eee_2' ;
  30 , 'name' , 'eee_3' ;
};
M_.mapping.a.eqidx = [4 12 25 ];
M_.mapping.c.eqidx = [2 3 4 12 ];
M_.mapping.de.eqidx = [2 15 17 22 23 ];
M_.mapping.deltau.eqidx = [9 10 18 ];
M_.mapping.deltauprime.eqidx = [8 11 ];
M_.mapping.expre.eqidx = [22 24 ];
M_.mapping.expre2.eqidx = [23 24 ];
M_.mapping.expvf1sigma.eqidx = [4 5 12 ];
M_.mapping.inv.eqidx = [9 17 18 19 ];
M_.mapping.k.eqidx = [1 2 7 8 9 17 18 19 ];
M_.mapping.mu.eqidx = [6 7 8 20 21 30 ];
M_.mapping.n.eqidx = [1 2 3 4 6 12 17 ];
M_.mapping.pe.eqidx = [15 22 23 ];
M_.mapping.pie.eqidx = [14 16 17 20 28 30 ];
M_.mapping.profit.eqidx = [21 ];
M_.mapping.q.eqidx = [8 18 19 ];
M_.mapping.r.eqidx = [14 16 28 ];
M_.mapping.rr.eqidx = [2 13 17 29 ];
M_.mapping.rrk.eqidx = [7 18 ];
M_.mapping.sdf.eqidx = [12 13 14 15 18 20 28 29 30 ];
M_.mapping.u.eqidx = [1 7 8 10 11 18 ];
M_.mapping.varexpre.eqidx = [24 ];
M_.mapping.vf.eqidx = [4 5 12 ];
M_.mapping.vola.eqidx = [25 26 ];
M_.mapping.w.eqidx = [2 3 6 17 ];
M_.mapping.y.eqidx = [1 6 7 8 16 17 20 21 30 ];
M_.mapping.z.eqidx = [1 27 ];
M_.mapping.eee_1.eqidx = [28 ];
M_.mapping.eee_2.eqidx = [29 ];
M_.mapping.eee_3.eqidx = [30 ];
M_.mapping.ea.eqidx = [25 ];
M_.mapping.evola.eqidx = [26 ];
M_.mapping.ez.eqidx = [27 ];
M_.static_and_dynamic_models_differ = false;
M_.has_external_function = false;
M_.state_var = [1 2 8 10 12 17 24 26 27 ];
M_.exo_names_orig_ord = [1:3];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(30, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(3, 1);
M_.params = NaN(52, 1);
M_.endo_trends = struct('deflator', cell(30, 1), 'log_deflator', cell(30, 1), 'growth_factor', cell(30, 1), 'log_growth_factor', cell(30, 1));
M_.NNZDerivatives = [132; 279; 273; ];
M_.static_tmp_nbr = [15; 10; 0; 0; ];
M_.model_local_variables_static_tt_idxs = {
};
phikestimate			= 3.9208;
rhovolaestimate 		= 0.76889;
volvolaestimate		= 0.0043735;
volassestimate         = 0.0049905;
volzssestimate         = 0.018792;
rhoaestimate           = 0.98096;
rhozestimate           = 0.35026;
M_.params(1) = 0.333;
alpha = M_.params(1);
M_.params(2) = 0.994;
beta = M_.params(2);
M_.params(3) = 0.025;
delta0 = M_.params(3);
M_.params(4) = 1/M_.params(2)-1+M_.params(3);
delta1 = M_.params(4);
M_.params(5) = 0.00031;
delta2 = M_.params(5);
M_.params(7) = 240;
phip = M_.params(7);
M_.params(8) = phikestimate;
phik = M_.params(8);
M_.params(9) = 100;
sigma = M_.params(9);
M_.params(10) = 0.5;
ies = M_.params(10);
M_.params(11) = 2.0;
frischlse = M_.params(11);
M_.params(12) = (1-M_.params(9))/(1-1/M_.params(10));
thetavf = M_.params(12);
M_.params(13) = 6.0;
thetamu = M_.params(13);
M_.params(14) = 0.90;
leverageratio = M_.params(14);
M_.params(38) = 1.005;
piess = M_.params(38);
M_.params(41) = M_.params(38)/M_.params(2);
rss = M_.params(41);
M_.params(16) = 0.000;
rhor = M_.params(16);
M_.params(17) = 1.5;
rhopie = M_.params(17);
M_.params(18) = 0.2;
rhoy = M_.params(18);
M_.params(25) = 1;
ass = M_.params(25);
M_.params(19) = rhoaestimate;
rhoa = M_.params(19);
M_.params(48) = volassestimate;
volass = M_.params(48);
M_.params(20) = rhovolaestimate;
rhovola = M_.params(20);
M_.params(21) = volvolaestimate;
volvola = M_.params(21);
M_.params(52) = 1;
zss = M_.params(52);
M_.params(22) = rhozestimate;
rhoz = M_.params(22);
M_.params(49) = volzssestimate;
volzss = M_.params(49);
M_.params(51) = 1.0;
yss = M_.params(51);
M_.params(43) = 1/M_.params(2)-1+M_.params(3);
rrkss = M_.params(43);
M_.params(36) = M_.params(13)/(M_.params(13)-1);
muss = M_.params(36);
M_.params(45) = 1;
uss = M_.params(45);
M_.params(15) = (M_.params(36)-1)*M_.params(51);
fixedcost = M_.params(15);
M_.params(34) = M_.params(1)*(M_.params(51)+M_.params(15))/(M_.params(36)*M_.params(43));
kss = M_.params(34);
M_.params(33) = M_.params(3)*M_.params(34);
invss = M_.params(33);
M_.params(26) = M_.params(51)-M_.params(33);
css = M_.params(26);
nsssolution = fsolve(@(nssguess) 1+(-1+1/ies)/(1+((-1+alpha)*(-1+nssguess)*(fixedcost+yss))/(css*nssguess*muss)) -(frischlse/ies)*nssguess*(1-nssguess)^(-1),0.5,optimoptions('fsolve','Display','off'));
M_.params(35) = nsssolution;
nss = M_.params(35);
M_.params(50) = (M_.params(51)+M_.params(15))*(1-M_.params(1))/(M_.params(36)*M_.params(35));
wss = M_.params(50);
M_.params(6) = (1+M_.params(50)*(1-M_.params(35))/M_.params(26))^(-1);
eta = M_.params(6);
M_.params(40) = 1;
qss = M_.params(40);
M_.params(23) = (M_.params(51)+M_.params(15))/(M_.params(34)^M_.params(1)*M_.params(35)^(1-M_.params(1)));
productionconstant = M_.params(23);
M_.params(47) = 1;
vfss = M_.params(47);
M_.params(24) = M_.params(47)^((1-M_.params(9))/M_.params(12))*(1-M_.params(2))/(M_.params(26)^M_.params(6)*(1-M_.params(35))^(1-M_.params(6)))^((1-M_.params(9))/M_.params(12));
utilityconstant = M_.params(24);
M_.params(27) = M_.params(26)-M_.params(35)*M_.params(50)+M_.params(34)*M_.params(14)*(M_.params(2)-1);
dess = M_.params(27);
M_.params(37) = M_.params(2)*(1-M_.params(2))^(-1)*M_.params(27);
pess = M_.params(37);
M_.params(39) = (M_.params(36)-1)*M_.params(51)-M_.params(15);
profitss = M_.params(39);
M_.params(30) = 1/M_.params(2);
express = M_.params(30);
M_.params(31) = 1/M_.params(2)^2;
expre2ss = M_.params(31);
M_.params(46) = 0;
varexpress = M_.params(46);
M_.params(32) = M_.params(47)^(1-M_.params(9));
expvf1sigmass = M_.params(32);
M_.params(40) = 1;
qss = M_.params(40);
M_.params(42) = 1/M_.params(2);
rrss = M_.params(42);
M_.params(44) = M_.params(2);
sdfss = M_.params(44);
M_.params(28) = M_.params(3);
deltauss = M_.params(28);
M_.params(29) = M_.params(4);
deltauprimess = M_.params(29);
%
% INITVAL instructions
%
options_.initval_file = false;
oo_.steady_state(1) = M_.params(25);
oo_.steady_state(2) = M_.params(26);
oo_.steady_state(3) = M_.params(27);
oo_.steady_state(4) = M_.params(3);
oo_.steady_state(5) = M_.params(4);
oo_.steady_state(6) = M_.params(30);
oo_.steady_state(7) = M_.params(31);
oo_.steady_state(8) = M_.params(32);
oo_.steady_state(9) = M_.params(33);
oo_.steady_state(10) = M_.params(34);
oo_.steady_state(12) = M_.params(35);
oo_.steady_state(11) = M_.params(36);
oo_.steady_state(13) = M_.params(37);
oo_.steady_state(14) = M_.params(38);
oo_.steady_state(15) = M_.params(39);
oo_.steady_state(16) = M_.params(40);
oo_.steady_state(17) = M_.params(41);
oo_.steady_state(18) = M_.params(42);
oo_.steady_state(19) = M_.params(43);
oo_.steady_state(20) = M_.params(44);
oo_.steady_state(21) = M_.params(45);
oo_.steady_state(22) = M_.params(46);
oo_.steady_state(23) = M_.params(47);
oo_.steady_state(24) = M_.params(48);
oo_.steady_state(25) = M_.params(50);
oo_.steady_state(26) = M_.params(51);
oo_.steady_state(27) = M_.params(52);
oo_.steady_state(28) = 0;
oo_.steady_state(29) = 0;
oo_.steady_state(30) = 0;
if M_.exo_nbr > 0
	oo_.exo_simul = ones(M_.maximum_lag,1)*oo_.exo_steady_state';
end
if M_.exo_det_nbr > 0
	oo_.exo_det_simul = ones(M_.maximum_lag,1)*oo_.exo_det_steady_state';
end
steady;
oo_.dr.eigval = check(M_,options_,oo_);
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = 1;
M_.Sigma_e(2, 2) = 1;
M_.Sigma_e(3, 3) = 1;
options_.k_order_solver = true;
options_.irf = 0;
options_.nocorr = true;
options_.nofunctions = true;
options_.nograph = true;
options_.nomoments = true;
options_.noprint = true;
options_.order = 3;
options_.periods = 0;
var_list_ = {};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);


oo_.time = toc(tic0);
disp(['Total computing time : ' dynsec2hms(oo_.time) ]);
if ~exist([M_.dname filesep 'Output'],'dir')
    mkdir(M_.dname,'Output');
end
save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'bbeffectivedemandmatchirf_order3_results.mat'], 'oo_recursive_', '-append');
end
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
